// 控制头部 task 方框的颜色
		   var nmber_lenght=$(".h_heade").length;
			 $(".h_heade").css({"background-color":"rgba(59, 205, 205, 1)"})  
			 for(var int=0;int<nmber_lenght;int++){ 
				   if(int% 2 == 0){  
						  document.getElementsByClassName("h_heade")[int].style.backgroundColor="rgba(90, 127, 244, 1)";
					 }else{
						 document.getElementsByClassName("h_heade")[int].style.backgroundColor="rgba(59, 205, 205, 1)"; 
					 }
			 }
			 $(function(){
				 $(".h_top_button1").click(function(){
				 	if($(".h_centeer_dog").css('display') == 'none'){
				 		
					}else{
						$(".h_centeer_dog").css({
							 "display":"none"
						 })
						$(".h_top_button1").hide();
						$('.h_top_button4').show();
					}
				 })
				 $('.h_top_button4 input').on('change',function(){
				 	var fileObj = $(this)[0].files[0];
				 	var trStr = `
				 		<tr>
			              <td>${fileObj.name}</td>
			              <td>导入人</td>
			              <td>${fileObj.type}</td>
			              <td>${getNowFormatDate()}</td>
			              <td class="up-start">开始上传</td>
			            </tr>
				 	`;
				 	$('.h_table').append(trStr);
				 })
				 $('.up-start').on('click',function(){
				 	console.log($(this).html());
				 	if($(this).text().replace(/^\s+|\s+$/g,"") == '开始上传'){
				 		layer.confirm('是否上传文件？', {
				 			  icon: 3,
							  btn: ['确定','取消'] //按钮
							}, function(){ //点击确定
							  layer.msg('正在开始上传', {icon: 1});
							}, function(){
							  
						});
				 		
				 	}else if($(this).text().replace(/^\s+|\s+$/g,"") == '上传成功'){
				 		layer.alert('无需重复炒作', {
						  icon: 2,
						  skin: 'layer-ext-moon' 
						})
				 	}else{
				 		layer.alert('无需重复炒作', {
						  icon: 2,
						  skin: 'layer-ext-moon' 
						})
				 	}
				 })
				function getNowFormatDate() {
				    var date = new Date();
				    var seperator1 = "-";
				    var seperator2 = ":";
				    var month = date.getMonth() + 1;
				    var strDate = date.getDate();
				    if (month >= 1 && month <= 9) {
				        month = "0" + month;
				    }
				    if (strDate >= 0 && strDate <= 9) {
				        strDate = "0" + strDate;
				    }
				    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
				            + " " + date.getHours() + seperator2 + date.getMinutes()
				            + seperator2 + date.getSeconds();
				    return currentdate;
				}
			 })
			 $(function(){
				  var  backgroundCorlor,corlor ;
				 $(".h_xianxiang div").click(function(){
					 $(".h_xianxiang div").css({
							 "background-color":"rgba(242, 242, 242, 1)",
							 "color":"#000000"
					 })  
					 $(this).css({
							 "background-color":"rgba(22, 155, 213, 1)",
							 "color":"#ffffff"
					 })
					 backgroundCorlor="rgba(22, 155, 213, 1)";
					 corlor= "#ffffff";
				 })
				 $(".h_xianxiang div").mouseover(function(){  
								 backgroundCorlor=$(this)[0].style.backgroundColor;
								 corlor=$(this)[0].style.color; 
							 $(this).css({
									 "background-color":"rgba(22, 155, 213, 1)",
									 "color":"#ffffff"
							 })
								$(".h_xianxiang div").mouseout(function(){  
									$(this).css({
											"background-color":backgroundCorlor,
											"color":corlor
									})
								})
					})
				})
				$(function(){
				  $(".h_xianxiang_centen").click(function(){
				 	   window.location.href = 'zi_liao2.html';   
					}); 
					 $(".h_xianxiang_right").click(function(){
							window.location.href='zi_liao3.html';
					}); 
					$(".h_xianxiang_left").click(function(){
						window.location.href = 'zi_liao1.html';   
					});
				})
			 $(function(){
				 // 通过
				 $(".lieebiao_leirong >ul >li:nth-child(8) > div:nth-child(1)").click(function(){   
					            $(".h_tangkuang_1").css({
									"margin-left":"0%"
								}) 
								$(".h_tangkuang_2").css({
									"margin-left":"0%"
								}) 
								if($(".h_liniao_tankuan")[0].style.display=="none"){
									$(".h_liniao_tankuan").css({
										"display":"block"
									}) 
								}else{
									$(".h_liniao_tankuan").css({
										"display":"none"
									})
								}
				 			    $(".h_tangkuang_2").css({"display":"none"}),
				 				$(".h_tangkuang_1").css({"display":"block"})
				 				
							
				 })
				 $(".h_y_tankuan_yes").click(function(){  
					     $(".h_tangkuang_1").animate({marginLeft:"-100%" });
							 setTimeout(function(){
								  $(".h_liniao_tankuan").css({
								     "display":"none"
							   })
							 },1000); 
				 })
				 // 驳回
				 $(".lieebiao_leirong >ul >li:nth-child(8) > div:nth-child(3)").click(function(){   
				 			$(".h_tangkuang_1").css({
				 				"margin-left":"0%"
				 			}) 
				 			$(".h_tangkuang_2").css({
				 				"margin-left":"0%"
				 			}) 
				 			if($(".h_liniao_tankuan")[0].style.display=="none"){
				 				$(".h_liniao_tankuan").css({
				 					"display":"block"
				 				}) 
				 			}else{
				 				$(".h_liniao_tankuan").css({
				 					"display":"none"
				 				})
				 			}
				 			 $(".h_tangkuang_1").css({"display":"none"}),
							 $(".h_tangkuang_2").css({"display":"block"})

				 		
				 })
				 $(".h_y_tankuan_yes").click(function(){
					      
				 			$(".h_tangkuang_2").animate({marginLeft:"-100%"});
				 			setTimeout(function(){
				 				$(".h_liniao_tankuan").css({
				 				"display":"none"
				 				})
				 			},1000); 
				 })
	 })
			 
	 $(function(){
	 	
		 $(".h_top_button1").click(function(){
			 $(".h_top_button2").css({"display":"none"});
			  $(".h_top_button3").css({"display":"block"});
			 $(".h_top_button1").css({"left":"84.8%"});
			 
			 $(".h_ziliao_daoru").css({"display":"block"});

		 })
		  $(".h_top_button3").click(function(){  
			  if($(".h_ziliao_daorutangkuang")[0].style.display=="none"){
				   $(".h_ziliao_daorutangkuang").css({"display":"block"});
			  }else{
				  $(".h_ziliao_daorutangkuang").css({"display":"none"});
			  }
			
		  })
		  
		 $(".h_y_tankuan_no_ywq").click(function(){
			  $(".h_ziliao_daorutangkuang").css({
				  "display":"none"
			  })
		 });
		 $(".h_y_tankuan_yes_ywq").click(function(){
		 	 $(".h_monan_jindu").css({
			 		 		"display":"block"
			 })
		 });
		 $(".h_querem").click(function(){
			 $(".h_monan_jindu").css({
			 		 		"display":"none"
			 })
		 })
		 //查看资料
		$('.chak-info').on('click',function(){
			$('.h_centeer_dog').hide();
			$('.s-b-c-bottom').hide();
			$('.chak-info-box').show();
		})
		$('.chak-sh').on('click',function(){
			$('.chak-qd').removeClass('hide');
			$('.chak-qx').removeClass('hide');
			$('.chak-tg').addClass('hide');
			$('.chak-bh').addClass('hide');
			$('.chak-sh').addClass('hide');
			$('.c-l-i-select').removeClass('hide');
			$('.c-r-i-select').removeClass('hide');
			var inputArr = $('.chak-info-box-cont').find('input');
			$.each(inputArr, function(i,v) {
				$(v).removeAttr('disabled');
			});
			var textareaArr = $('.chak-info-box-cont').find('textarea');
			$.each(textareaArr, function(i,v) {
				$(v).removeAttr('disabled');
			});
			$('.chak-cont-buttom').hide();
			$('.chak-cont-footer').hide();
			$('.chak-item-zl-btn').show();
			$('.c-l-i-text-radio').show();
		})
		$('.chak-item-zl').on('click','.chak-item-zl-btn',function(){
			var _this = this;
			if($(this).parent().index() == 0){
				console.log(this);
				var str = `
					<div class="chak-item-box">
		              	<div class="chak-item-zl-btn">
		              		<img src="images/shanchu.png"/>
		              	</div>
		              	<div class="chak-left-item">
			                <div class="c-l-i-title">主力类型：</div>
			                <div class="c-l-i-text"><input type="text" name=""  id="" value="" /></div>
			              </div>
			              <div class="chak-left-item">
			                <div class="c-l-i-title">主力价格带：</div>
			                <div class="c-l-i-price">
			                  <div class="price-box-cont">
			                    <div class="price-box">
			                      <img src="images/u3617.png" />
			                      <input type="text" name="price1" id="price1"  value="" /></div>~
			                    <div class="price-box">
			                      <img src="images/u3617.png" />
			                      <input type="text" name="price2" id="price2"  value="" /></div></div>
			                </div>
			              </div>
			              <div class="chak-left-item">
			                <div class="c-l-i-title">风格描述：</div>
			                <div class="c-l-i-text">
			                	<textarea name=""  rows="" cols=""></textarea>
			                </div>
			              </div>
		              </div>
				`;
				$('.chak-item-zl').append(str);
				layer.msg('添加成功',{icon:1})
			}else{
				layer.confirm('是否删除？', {
				  btn: ['确定','取消'] //按钮
				}, function(){
				 	$(_this).parent().remove();
					layer.msg('删除成功',{icon:1})
				}, function(){
				   
				});
			}
		})
		$('.c-l-i-text-radio').on('click','.radio-show',function(){
			var _this = this;
			$(_this).parent().siblings().find('img').addClass('hide');
			var textValue = $(_this).siblings('span').text();
			if($(_this).find('img').attr('class') == 'hide'){
				$(_this).find('img').removeClass('hide');
			}else{
				$(_this).find('img').addClass('hide');
			}
			var imgArr = $(_this).parents('.c-l-i-text-radio').find('img');
			$(_this).parents('.c-l-i-text-radio').siblings().val(textValue);
		})
		$('.chak-qx').on('click',function(){
			$('.chak-qd').addClass('hide');
			$('.chak-qx').addClass('hide');
			$('.chak-tg').removeClass('hide');
			$('.chak-bh').removeClass('hide');
			$('.chak-sh').removeClass('hide');
			$('.c-l-i-select').addClass('hide');
			$('.c-r-i-select').addClass('hide');
			var inputArr = $('.chak-info-box-cont').find('input');
			$.each(inputArr, function(i,v) {
				$(v).attr('disabled','disabled');
			});
			var textareaArr = $('.chak-info-box-cont').find('textarea');
			$.each(textareaArr, function(i,v) {
				$(v).attr('disabled','disabled')
			});
			$('.chak-cont-buttom').show();
			$('.chak-cont-footer').show();
			$('.chak-item-zl-btn').hide();
			$('.c-l-i-text-radio').hide();
		})
		var flag = true;
		var flag2 = true;
		$('.c-l-i-select').on('click','img',function(){
			if(flag){
				var height = $('.c-l-i-select-cont ul').height();
				$('.c-l-i-select-cont').css({'z-index' : 12,'opacity':'1'})
				flag = false;
			}else{
				$('.c-l-i-select-cont').css({'z-index' : 0,'opacity':'0'})
				flag = true;
			}
		})
		$('.c-l-i-select .select-cont-menu').on('click','li',function(){
			var value = $(this).text();
			var obj = $(this).parents('.c-l-i-select').siblings('.c-l-i-text').text(value);
			$('.c-l-i-select-cont').css({'opacity':'0'});
			flag = true;
			return false;
		})
		$('.c-r-i-select').on('click','img',function(){
			if(flag2){
				var height = $('.c-r-i-select-cont ul').height();
				$('.c-r-i-select-cont').css({'z-index' : 12,'opacity':'1'})
				flag2 = false;
			}else{
				$('.c-r-i-select-cont').css({'z-index' : 0,'opacity':'0'})
				flag2 = true;
			}
		})
		$('.c-r-i-select').on('click','li',function(){
			var value = $(this).text();
			var obj = $(this).parents('.c-r-i-select').siblings('.c-r-i-text-span').text(value);
			$('.c-r-i-select-cont').css({'opacity':'0'});
			flag2 = true;
			return false;
		})
		$('.c-l-i-album').on('change','input',function(){
			var $file = $(this);
	        var fileObj = $file[0];
	        var windowURL = window.URL || window.webkitURL;
	        var dataURL;
	        var $img = $(this).siblings();
	        if($img.length > 0){
	        	if (fileObj && fileObj.files && fileObj.files[0]) {
		            dataURL = windowURL.createObjectURL(fileObj.files[0]);
		            $img.attr('src', dataURL);
		        } else {
		            dataURL = $file.val();
		            var imgObj = document.getElementById("preview");
		            // 两个坑:
		            // 1、在设置filter属性时，元素必须已经存在在DOM树中，动态创建的Node，也需要在设置属性前加入到DOM中，先设置属性在加入，无效；
		            // 2、src属性需要像下面的方式添加，上面的两种方式添加，无效；
		            imgObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
		            imgObj.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = dataURL;
		
		        }
	        }else{
	        	var imgObj = document.createElement('img');
	        	imgObj.src  = windowURL.createObjectURL(fileObj.files[0]);;
	        	$file.before(imgObj);
	        }
	        
		})
		$('.chak-qd').on('click',function(){
			window.history.go(-1);
		})
		$('.chak-tg').on('click',function(){
			window.history.go(-1);
		})
		$('.chak-bh').on('click',function(){
			window.history.go(-1);
		})
		$('.h_top_button2').on('click',function(){
			console.log('ddd');
			window.location.href = 'yz.html';
		})
		iFrmaeHight();
		$(window).resize(function(){
			iFrmaeHight();
		})
		function iFrmaeHight(){
			$('.chak-info-box-cont').height($('.h_centent').height() - 152);
			
		}
	 })
			